// 4. 写一个Promise的例子


let p1 = new Promise(
    (resolve, reject)=>{
        
        setTimeout(() => {
            resolve({username: 'tom', age: 18})
        }, 5000);
       
    }
)

async function getResponse(){
    const response = await p1
    console.log('server response: ',response)
}

getResponse()

console.log('js main thread...');